package edu.spec.lyq.week08.class1.book.unit3.two;

public class Student {
    private int sNO;
    private String sName;
    private String sSex;
    private int sAge;
    private double sJava;

    public Student(){}
    public Student(int sNO, String  sName, String  sSex, int sAge, double sJava){
        this.sNO=sNO;
        this.sName=sName;
        this.sSex=sSex;
        this.sAge=sAge;
        this.sJava=sJava;
    }
    public int getNo(){
        return this.sNO;
    }
    public String getName(){
        return this.sName;
    }
    public String getSex(){
        return this.sSex;
    }
    public int getAge(){
        return this.sAge;
    }
    public double getJava(){
        return this.sJava;
    }

    public static void main(String[] args){

        Student s1=new Student(1,"叶凡","男",20,90);
        Student s2=new Student(2,"萧炎","男",18,91);
        Student s3=new Student(3,"林动","男",18,70);
        Student s4=new Student(4,"无始","男",25,85);
        Student s5=new Student(5,"狠人","女",300,95);

        System.out.println("学生的信息");
        System.out.println("学号 姓名 性别 年龄 java");
        System.out.println(s1.getNo() +"\t"+s1.getName()+"\t"+s1.getSex()+"\t" +s1.getAge()+"\t"+s1.getJava());
        System.out.println(s2.getNo() +"\t"+s2.getName() +"\t"+s2.getSex()+"\t" +s2.getAge()+"\t"+s2.getJava());
        System.out.println(s3.getNo() +"\t"+s3.getName() +"\t"+s3.getSex()+"\t" +s3.getAge()+"\t"+s3.getJava());
        System.out.println(s4.getNo() +"\t"+s4.getName() +"\t"+s4.getSex()+"\t" +s4.getAge()+"\t"+s4.getJava());
        System.out.println(s5.getNo() +"\t"+s5.getName() +"\t"+s5.getSex()+"\t" +s5.getAge()+"\t"+s5.getJava());

        double avg=(s1.getJava()+s2.getJava()+s3.getJava()+s4.getJava()+s5.getJava())/5;
        System.out.println("java平均成绩"+avg);

        double []javaScore={s1.getJava(),s2.getJava(),s3.getJava(),s4.getJava(),s5.getJava()};
        double max=0,min=0;
        for(int i=0;i<4;i++){
            for(int j =i+1;j<5;j++)
                if(javaScore[i]<javaScore[j]){
                    double temp=javaScore[i];
                    javaScore[i]=javaScore[j];
                    javaScore[j]=temp;
                }
        }
        System.out.println("Java最高分为:"+javaScore[0]);
        System.out.println("Java最低分为:"+javaScore[4]);

    }
}
